﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>跨域问题研究</title>
<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
</head>
<body>
首先需要在fiddler里面做相应设置
<div id="content"></div>
<!--<iframe src="http://www.sohu.com" height=0 width=0></iframe>-->
<script>
//
//document.domain = "mbn.com";
//alert(XMLHttpRequest);
var x = getRequest();
var url = "http://beanbean.be.funpic.org/x.html";
x.open("GET", url, true);
x.send(null);
x.onreadystatechange = function(){
	if(x.readyState==4){
		alert(x.responseText);
	}
}
function getRequest(){
	var _x;
	if(typeof XMLHttpRequest=="function"){
		_x = new XMLHttpRequest();
	}else{
		try{ _x =  new ActiveXObject("Msxml2.XMLHTTP");}catch(e){
			try { _x = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
				throw("F***", "什么烂浏览器，Ajax也不支持，BS！");
			} 
		}
	}
	return _x;
}
/*
jQuery.ajax({
	url:"http://beanbean.be.funpic.org/x.html",
	success:function(a,b,c){alert(a)}
});*/
</script>
</body>
</html>
